<?php
	class Translator {
		private $xmlFile;
		
		public function __construct($lang) {
			$this->xmlFile = new SimpleXMLELEMENT("lang/" . $lang . ".xml", NULL, TRUE);
			
		}	
		
		public function read($page, $node, $subnode) {
			$value =  $this->xmlFile->$page->$node->$subnode;
			
			if (strlen($value) == 0) {
				$value = "<i>Texte inexistant</i>";	
			}
			
			return utf8_decode($value);
		}
	}
?>